	$(function(){
	   easyloader.base = 'js/tools/easyui/';
	   using("locale/easyui-lang-zh_CN.js",function(){
	      var columns=[[
	                              {field: 'title',title: '标题',width: 100,align: 'left'},
						          {field: 'username',title: '留言人',width: 70,align: 'center'},
								  {field: 'content',title: '内容',width: 150,align: 'left'},
								   {field: 'tel',title: '电话',width: 120,align: 'left'}, 
								   {field: 'tel',title: 'Email',width: 120,align: 'left'}, 
						          {field: 'datetime',title: '留言时间',width: 120,align: 'left'}, 
								  {field: 'reply',title: '回复',width: 150,align: 'left'}, 
								  {field: 'replyDatetime',title: '回复时间',width: 120,align: 'left'}, 
								  {field: 'opt',title: '操作',width: 90,align: 'center'}
							 ]];
	         createDateGrid(columns,'feedback!feedbackListForJson.action','',true,560);
	   });
	   $("#dialog").dialog();
	
	});
	var feedbackId;
	//回复
	function reply(id)
	{
		feedbackId=id;
	   $('#dialog').dialog('setTitle',"回复");
	    $('#dialog').dialog('open');
	}
	//保存
	function save()
	{
		var reply=$.trim($("#reply").val());
		if(reply.length<1||reply.length>300)
		{
		　　　alert("回复内容在1~300之间！");
		   return false;
		}
		$.getJSON("feedback!modifyFeedback.action",{"feedback.id":feedbackId,"feedback.reply":encodeURI(reply)},function(data){
			if(data.info)
			{
				$("#dataGrid").datagrid("reload");
				$('#dialog').dialog('close');
				alert("回复成功!");
			}else
			{
				alert("回复失败!");
			}
		});
	}
  
	//删除链接
	function deleteFeedback(id)
	{
		$.getJSON("feedback!deleteFeedback.action",{"feedback.id":id},function(data){
			if(data.info)
			{
				$("#dataGrid").datagrid("reload");
				alert("删除成功!");
			}else
			{
				alert("删除失败!");
			}
		});
	}
